﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using System.Data;
using System.Text.RegularExpressions;
using umbraco.cms;

namespace Our.Umbraco.uDbCompare
{
    public partial class info : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void SyncTemplateButton_OnClick(object sender, EventArgs e)
        {
            var templates = global::umbraco.cms.businesslogic.template.Template.GetAllAsList();
            foreach (var template in templates)
            {
                // looks a bit silly, but the set propery does a db save
                template.Text = template.Text;
                template.Alias = template.Alias;
                template.MasterTemplate = template.MasterTemplate;
                template.Design = template.Design;

                template.Save();
            }
        }

    }
}
